
#include "main_inc.h"
#include "clog.h"
#include "dbtime.h"
#include "exceptions.h"
#include "dbarch.h"
#include "..\version.h"
#include "dbserver.h"
#include "dbparachute.h"


int build_ver = AutoVersion::BUILDS_COUNT;



int main()
{
	CLog log;
	log.StartLog ( "worklog.txt" );
	DBArch arch;
	vector<dbf_search_result> results;
	DBParachute::PARA()->WriteMsg ( time ( 0 ), 0, "DIAGNOSTIC:System start" );
	Pipe init_pipe;

    DBServer *server;

	try
	{

		server = DBServer::startServer();
		time_t loop = time ( 0 ) + 200;

		while ( loop >= time ( 0 ) )
		{
			Sleep ( 500 );
            server->ProcessQuee();

		}
	}
	catch ( cexception )
	{
		LOGP1 ( "[ERROR]EXCEPTION!!!" );
	}

	DBParachute::PARA()->WriteMsg ( time ( 0 ), 0, "DIAGNOSTIC:System stop" );
	return 0;
}
